home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / amiga.programming / comp.sys.amiga.programmer_10291_000065.msg < prev    next >
Encoding:
Internet Message Format  |  1994-11-27  |  2.1 KB

  1. Path: dd.chalmers.se!news.chalmers.se!sunic!EU.net!howland.reston.ans.net!vixen.cso.uiuc.edu!sdd.hp.com!sgiblab!idiom.berkeley.ca.us!apollo.west.oic.com!apollo.west.oic.com!not-for-mail
  2. From: dillon@apollo.west.oic.com (Matthew Dillon)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Task Priority Question
  5. Date: 4 May 1994 21:40:23 -0700
  6. Organization: Obvious Implementations Corp
  7. Lines: 38
  8. Distribution: world
  9. Message-ID: <2q9tbn$hn4@apollo.west.oic.com>
  10. References: <Cp8H3x.86A@festival.ed.ac.uk> <1994May4.140305.25547@ousrvr.oulu.fi>
  11. NNTP-Posting-Host: apollo.west.oic.com
  12.  
  13. In article <1994May4.140305.25547@ousrvr.oulu.fi> kilroy@tolsun.oulu.fi (Lauri Aalto) writes:
  14. :In article <Cp8H3x.86A@festival.ed.ac.uk> andrewb@castle.ed.ac.uk (Andrew Begg) writes:
  15. :>What functions allow me to change the priority of my C programs so that 
  16. :>the CPU gives more (or, perhaps, all) of its time to my code?  
  17. :
  18. :oldpri = SetTaskPri(FindTask(0L),newpri);
  19. :/* do your stuff here */
  20. :SetTaskPri(FindTask(0L),oldpri); /* reset priority */
  21. :
  22. :
  23. :
  24. :
  25. :      (__)    Lauri Aalto
  26. :    w \@@/    kilroy@tolsun.oulu.fi
  27. :     `/v/-e   2:228/406.2@fidonet
  28. :    _/  \_    ...Intel inside--idiot outside...
  29.  
  30.     Be careful... the Amiga only round-robins processes running at the
  31.     same priority, if you set your priority higher your process can
  32.     take ALL the available cpu, locking out everything else.  Most
  33.     processes run at priority 0, setting yours to priority 1 is usually
  34.     sufficient if you need extra CPU, but even that will lock out (while
  35.     you are not blocked waiting for something) all other user processes.
  36.     It doesn't block out the filesystem code or input.device... you have
  37.     to up your priority to 20 or more to do that, but it blocks out enough
  38.     to make the machine unusable if your process gets into an infinite
  39.     loop at that priority.
  40.  
  41.                         -Matt
  42.  
  43. -- 
  44.  
  45.     Matthew Dillon        dillon@apollo.west.oic.com
  46.     1005 Apollo Way
  47.     Incline Village, NV. 89451    ham: KC6LVW (no mail drop)
  48.     USA             Sandel-Avery Engineering (702)831-8000
  49.     [always include a portion of the original email in any response!]
  50.